package org.mech.sefer.event.register;

/**
 * <p>
 * The HandlerRegistrationInfo is configuration object for handler registration.
 * </p>
 * <p>
 * Date: 23.4.2012 12:01:17
 * </p>
 * 
 * @author martin.krajc
 */
public class HandlerRegistrationInfo {

	/**
	 * <p>
	 * The Order of handler in registry, when registering. Default is
	 * {@link #LAST}.
	 * </p>
	 * <p>
	 * Date: 23.4.2012 12:01:17
	 * </p>
	 * 
	 * @author martin.krajc
	 */
	public enum Order {

		/** The FIRST. */
		FIRST,
		/** The LAST. */
		LAST
	}

	/** The lazy. */
	private final boolean lazy;

	/** The order. */
	private final Order order;

	/**
	 * Instantiates a new handler registration info. It calls
	 * {@link #HandlerRegistrationInfo(boolean, Order)} with default values: lazy is
	 * false and order is LAST.
	 */
	public HandlerRegistrationInfo() {
		this(false, Order.LAST);
	}

	/**
	 * Instantiates a new handler registration info.
	 * 
	 * @param lazy
	 *            if lazy true. Object will not register until register method
	 *            on Handler registration will be called.
	 * @param order
	 *            the order
	 */
	public HandlerRegistrationInfo(boolean lazy, Order order) {
		super();
		this.lazy = lazy;
		this.order = order;
	}

	/**
	 * Checks if lazy is set to true
	 * 
	 * @return true, if is lazy
	 */
	public boolean isLazy() {
		return lazy;
	}

	/**
	 * Gets the order.
	 * 
	 * @return the order
	 */
	public Order getOrder() {
		return order;
	}

}
